import numpy as np
import pandas as pd

s=pd.Series(8,index=[1,2,3])
print(s)

s=pd.Series(np.arange(3),index=[4,5,6])
print(s)

s=pd.Series(['a','b','c','d'],index=(10,17,2,22))
print(s)

data={'d':0,'a':2,'c':1}
s=pd.Series(data)
print(s)

data={'d':0,'a':2,'c':1}
s=pd.Series(data,index=['a','b','c','d'])
print(s)

date=np.arange(12).reshape(3,4)
df = pd.DataFrame(date,index=['a','b','c'],columns=['c1','c2','c3','c4'])
print(df)

data={'month':['January','February','March','April'],
      'income':[10000,30000,50000,40000],
      'tax':[500,1500,2500,2000]}
df3=pd.DataFrame(data)
print(df3)
print('DataFrame的数据值:',df3.values)
print('DataFrame的列名:',df3.columns)
print('DataFrame的维度:',df3.ndim)
print('DataFrame的元素个数:',df3.size)
print('DataFrame的索引:',df3.index)

date={'month':['january','february','march','april'],'income':[10000,30000,50000,400000],'tax':[500,1500,2500,2000]}
df=pd.DataFrame(date)
print(df)

df=pd.read_csv(filepath_or_buffer='data/phone.csv',header=None)
print(df)